<template>
  <div id="polyline">
    <div class="the-title">
      <span>传感器趋势</span>
      <span>纵压强/帕</span>
    </div>
    <div style="display: flex;background-color: rgb(28, 93, 219);">
      <div ref="main" style="width: 100%;height: 300px; flex: 1;"></div>
      <div style="width: 70px;margin-top: 30px;">
       <el-checkbox-group v-model="checkList" :class="{'wrap-checkbox':true}">
          <el-checkbox :label="'PS'+index"  v-for="(item , index) in 10" :key="item"></el-checkbox>
        </el-checkbox-group>
      </div>
    </div>
  </div>
</template>

<script>
  export default{
    data(){
      return{
        checkList:[]
      }
    },
    mounted() {
      let myChart = this.$echarts.init(this.$refs.main);
      var option = {
          grid: {
            top:30,
          },
          tooltip: {
            trigger: 'axis',
            axisPointer: {
                type: 'cross',
                label: {
                  backgroundColor: '#6a7985'
                }
            }
          },
          // legend: {
          //     icon: "circle",
          //     itemWidth: 12,
          //     itemHeight: 8,
          //     itemGap: 20,
          //     right:'5px',
          //     top:'30px',
          //     orient: 'vertical',
          //     selectedMode:true,
          //     data: ['邮件营销', '联盟广告', '视频广告', '直接访问', '搜索引擎']
          // },
          grid: {
            left: '3%',
            right: '30px',
            bottom: '3%',
            top:'20px',
            containLabel: true
          },
          xAxis: [
            {
              type: 'category',
              left: '100%',
              boundaryGap: false,
              data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
              axisLine: {
                lineStyle: {
                  color: "#FFFFFF"
                }
              }
            }
          ],
          yAxis: [
            {
              type: 'value',
              axisLine: {
                lineStyle: {
                  color: "#FFFFFF"
                }
              }
            }
          ],
          series: [
            {
              name: '邮件营销',
              type: 'line',
              stack: '总量',
              areaStyle: {},
              data: [120, 132, 101, 134, 90, 230, 210]
            },
          ]
      };
      myChart.setOption(option);
    }
  }
</script>

<style scoped="scoped">
  .the-title{
    margin: 10px 0;
  }
  .the-title span:nth-child(1){
    color: rgb(26, 187, 229)
  }
  .the-title span:nth-child(2){
    color: #6392d6;
    font-size: 12px;
  }
  .wrap-checkbox{
   display: flex;
   flex-direction: column;
   justify-content: flex-start;
   flex-wrap: wrap;
  }
</style>
